<?php
namespace app\index\controller;

use think\Controller;

class Index extends Common
{

	public function _initialize()
    {   
        parent::_initialize();
    }

    public function index(){
    	//首页banner 轮播图
    	$where['is_home'] = ['eq',1]; //首页推荐 1
        $where['status'] = ['eq',1]; //状态 1 开启
        $banner = db('filmstrip')->field('id,img,create_time')->where($where)->select();
        if(empty($banner)){
            $banner = "";
        }
        $this->assign('banner',$banner);
        //查询列表
        $wheres['status'] = ['eq',1]; //状态是否正常 1正常
        $a_list = db('article')->where($wheres)->limit(0,6)->order('create_time desc')->select();
        $this->assign('list',$a_list);

        db('word')->where('id','1')->setInc('word');//首页访问量
        return $this->fetch();
    }

    public function nohtml(){
        return $this->fetch();
    }

}
